﻿// ***********************************************************************
// Provided for Informational Purposes Only
//
// Apache 2.0 License
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY 
// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR 
// PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
//
// See the Apache Version 2.0 License for specific language governing
// permissions and limitations under the License.
// ***********************************************************************
// Assembly  : ContractMeow.Api.WinRT
// File      : IAuthClient.cs
//
// ***********************************************************************
using ContractMeow.Api.Dtos;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace ContractMeow.Api.Clients
{
	/// <summary>
	/// Interface for making Authenticating call to the API (specifies the contract of an Authentication client)
	/// </summary>
	public interface IAuthClient : IApiClient
	{
		/// <summary>
		/// Authenticates the async.
		/// </summary>
		/// <param name="username">The username.</param>
		/// <param name="password">The password.</param>
		/// <returns>Task{AuthEnvelope}.</returns>
		Task<AuthEnvelope> AuthenticateAsync(String username, String password);

		/// <summary>
		/// Gets the principal async.
		/// </summary>
		/// <param name="username">The username.</param>
		/// <param name="password">The password.</param>
		/// <returns>Task{Principal}.</returns>
		Task<Principal> GetPrincipalAsync(String username, String password);

		/// <summary>
		/// Gets all tokens async.
		/// </summary>
		/// <param name="principal">The principal.</param>
		/// <returns>Task{IList{AccessToken}}.</returns>
		Task<IList<AccessToken>> GetAllTokensAsync(Principal principal);

		/// <summary>
		/// Hydrates the token async.
		/// </summary>
		/// <param name="token">The token.</param>
		/// <returns>Task{AccessToken}.</returns>
		Task<AccessToken> HydrateTokenAsync(String token);
		/// <summary>
		/// Gets the cookie store.
		/// </summary>
		/// <value>The cookie store.</value>
		ICookieStore CookieStore { get; }
	}
}
